<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>修改密码</title>
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/static/jquery-easyui-1.5.3/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/static/jquery-easyui-1.5.3/themes/icon.css">
    <script type="text/javascript"
            src="${pageContext.request.contextPath}/static/jquery-easyui-1.5.3/jquery.min.js"></script>
    <script type="text/javascript"
            src="${pageContext.request.contextPath}/static/jquery-easyui-1.5.3/jquery.easyui.min.js"></script>
    <script type="text/javascript"
            src="${pageContext.request.contextPath}/static/jquery-easyui-1.5.3/locale/easyui-lang-zh_CN.js"></script>
</head>
<body>
<div align="center">
    <form id="ff" method="post" action="/userInfo/client/rePwd" enctype="multipart/form-data">
        <table cellpadding="5">
            <tr>
                <td>账号：</td>
                <td><input class="easyui-textbox" type="text" id="username" name="username"
                           data-options="required:true"/></td>
            </tr>
            <tr>
                <td>密码：</td>
                <td><input class="easyui-textbox" type="password" name="pwd" data-options="required:true"/>
                </td>
            </tr>
            <tr>
                <td>新密码：</td>
                <td><input class="easyui-textbox" type="password" id="newpwd" name="newpwd" data-options="required:true"/>
                </td>
            </tr>
            <tr>
                <td>确认密码：</td>
                <td><input class="easyui-textbox" type="password" id="newpwd2" name="newpwd2" data-options="required:true"/>
                </td>
            </tr>
        </table>
    </form>
    <div style="text-align:center;padding:5px">
        <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm2()">提交</a>
        <a href="javascript:void(0)" style="margin-left: 20px" class="easyui-linkbutton" onclick="clearForm()">重置</a>
    </div>
</div>
</body>
<script>

    function submitForm2() {

        var new1 = $('#newpwd').val();
        var new2 = $('#newpwd2').val();
        if(new1 !== new2){
            $.messager.alert("提示","两次新密码输入不一致！","info");
            return;
        }

        $('#ff').form('submit', {
            onSubmit: function () {
                return $(this).form('enableValidation').form('validate');
            },
            success: function (data) {
                var r = JSON.parse(data);
                if (r.code == 0) {
                    $.messager.alert("提示", r.msg, "info");
                    closeWin();
                    reLoad();
                    clearSelections();
                } else {
                    $.messager.alert("提示", r.msg, "Warning")
                }
            }
        });
    }
</script>
<script>
</script>
</html>